using System;
using System.IO;

using log4net;

namespace SMSGateway.Common
{
    /// <summary>
    /// Author	: Vu Son Ha
    /// </summary>
    /// <summary>
    /// Create Date	: May, 20, 2010
    /// </summary>
    /// <summary>
    /// Version	:1.0
    /// </summary>	
    /// <summary>
    /// Description	: wrapper log4net for logging.
    /// </summary>
    public class Logger
    {
        /// <summary>
        /// logger
        /// </summary>
        static ILog logger = LogManager.GetLogger(typeof(Logger));
       
        /// <summary>
        /// debug
        /// </summary>
        /// <param name="obj">info to show</param>
        public static void Debug(object obj)
        {
#if DEBUG
            logger.Debug(obj);
#endif
        }
        
        /// <summary>
        /// info
        /// </summary>
        /// <param name="obj">info to show</param>
        public static void Info(object obj)
        {
#if DEBUG
            logger.Info(obj);
#endif
        }
        
        /// <summary>
        /// warn
        /// </summary>
        /// <param name="obj">info to show</param>
        public static void Warn(object obj)
        {
            logger.Warn(obj);
        }
        
        /// <summary>
        /// error
        /// </summary>
        /// <param name="obj">info to show</param>
        public static void Error(object obj)
        {
            logger.Error(obj);
        }
        
        /// <summary>
        /// debug
        /// </summary>
        /// <param name="obj">info to show</param>
        /// <param name="ex">exception to show</param>
        public static void Debug(object obj, Exception ex)
        {
#if DEBUG
            logger.Debug(obj, ex);
#endif
        }
        
        /// <summary>
        /// info
        /// </summary>
        /// <param name="obj">info to show</param>
        /// <param name="ex">exception to show</param>
        public static void Info(object obj, Exception ex)
        {
#if DEBUG
            logger.Info(obj, ex);
#endif
        }
        
        /// <summary>
        /// warn
        /// </summary>
        /// <param name="obj">info to show</param>
        /// <param name="ex">exception to show</param>
        public static void Warn(object obj, Exception ex)
        {
            logger.Warn(obj, ex);
        }
        
        /// <summary>
        /// error
        /// </summary>
        /// <param name="obj">info to show</param>
        /// <param name="ex">exception to show</param>
        public static void Error(object obj, Exception ex)
        {
            logger.Error(obj, ex);
        }

        public static void Warn(Exception ex)
        {
            logger.Warn("Exception: ", ex);
        }

        public static void Error(Exception ex)
        {
            logger.Error("Exception: ", ex);
        }
    }
}
